package cn.xiaoming.car.server.content.controller;

import cn.xiaoming.car.pojo.car.pojo.entity.DictDistrict;
import cn.xiaoming.car.pojo.car.pojo.vo.CarListItemVO;
import cn.xiaoming.car.pojo.car.pojo.vo.CarVO;
import cn.xiaoming.car.pojo.car.pojo.vo.DiscDistrictTreeItemVO;
import cn.xiaoming.car.server.ICarService;

import cn.xiaoming.car.server.IDictDistrictService;
import cn.xiaoming.car.server.jsonresult.JsonResult;
import cn.xiaoming.car.server.pojo.vo.PageData;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


/**
 * @author Anan
 */
@Slf4j
@RestController
@RequestMapping("/dict-district")
@Validated
public class DictDistrictController {

    @Autowired
    IDictDistrictService dictDistrictService;

    public DictDistrictController(){log.debug("创建控制类对象CarController");}

    @GetMapping("/{id}")
    public JsonResult selectByParentId(@PathVariable Long id){
        log.debug("开始处理【根据父级id查询地址】的请求参数：{}",id);
        List<DictDistrict> list =dictDistrictService.selectByParentId(id);
        return JsonResult.ok(list);
    }



}
